An inkjet printer as an example of a printer is known that performs printing by ejecting liquid from nozzles. The inkjet printer is a so-called a serial type and can perform bidirectional printing. The inkjet printer prints a plurality of ruled-line patterns, and allows a user to select a suitable ruled-line pattern among the plurality of ruled-line patterns. By determining ejection timing based on the selected ruled-line pattern, deviation of droplet landing positions in a scanning direction at the time when a print head is moved to one side of the scanning direction and when the print head is moved to the other side is suppressed in bidirectional printing.